<?php

/**
 * NOTICE OF LICENSE
 *
 * THIS SOURCE FILE IS PART OF EVEBIT'S PRIVATE PROJECT.
 * 
 * DO NOT USE THIS FILE IN OTHER PLACE.
 *
 * @package   App_Backend
 * @author    Cheng Wei <berlios.o@gmail.com>
 * @version   $$Id: CacheController.php 20 2010-12-18 09:35:07Z cheng.wei $$
 * @copyright Copyright (c) 2008 Evebit Inc. China (http://www.evebit.com)
 */

/**
 * Default controller for backend
 * 
 * @package   App_Backend
 * @author    Cheng Wei <berlios.o@gmail.com>
 * @version   $$Id: CacheController.php 20 2010-12-18 09:35:07Z cheng.wei $$
 */
class Default_CacheController extends Evebit_Controller_Action_Backend {
	
	/**
	 * Clear cache
	 */
	public function indexAction() {
		
	
	}
	
	/**
	 * Clear cache
	 */
	public function clearCacheAction() {
		/* @var $cache Zend_Cache_Core */
		$app = Evebit_Application::app();
		/* @var $cacheManager Zend_Cache_Manager */
		$cacheManager = $app->getBootstrap()->getResource('cachemanager');
		foreach ($cacheManager->getCaches() as $cache) {
			$cache->clean(Zend_Cache::CLEANING_MODE_ALL);
		}
		
		$this->getSession()->addSuccess($this->__("Cache Cleared"));
		$this->_forward("index", "cache", "default");
	}

}

